//
//  Fisa.m
//  iDent
//
//  Created by Marius Corega on 5/26/09.
//  Copyright 2009 Marius Corega. All rights reserved.
//

#import "Fisa.h"


@implementation Fisa

@synthesize pacient;

- (id)initWithXMLData: (NSData*) data
{
	self = [super initWithXMLData:data tableName:@"fisa" elementName:@"manopera"];
		
	return self;
}

-(id) initWithServerURL:(NSURL*) url
{
	NSMutableDictionary* d = [NSMutableDictionary dictionary];
	[d setObject:@"fisa" forKey:@"tabel"];
	self = [self initWithServerURL:url postDict:d];
	notification = @"FisaLoaded";
	
	return self;
}

- (NSMutableArray*)fisa
{
	return _elemente;
}

-(int) calculeazaDePlatit
{
	float deplatit = 0;
	
	for (int i=0; i<[_elemente count]; i++) {
		NSDictionary *dict = [_elemente objectAtIndex:i];
		deplatit += [[dict objectForKey:@"pret"] floatValue] - [[dict objectForKey:@"achitat"] floatValue];
	}
	return (int)deplatit;
}



@end
